package cn.myspringboot.system.service.impl;

import cn.myspringboot.base.service.impl.BaseServiceImpl;
import cn.myspringboot.system.mapper.PermissionMapper;
import cn.myspringboot.system.service.PermissionService;
import cn.myspringboot.user.domain.Permission;
import cn.myspringboot.user.query.PermissionQuery;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class PermissionServiceImpl extends BaseServiceImpl<Permission> implements PermissionService {
    @Autowired
    private PermissionMapper permissionMapper;
    @Override
    public PageInfo<Permission> queryPage(PermissionQuery query) {
        PageHelper.startPage(query.getPage(),query.getSize());
        List<Permission> articles = permissionMapper.queryPage(query);
        PageInfo<Permission> pageInfo = new PageInfo<>(articles);
        return pageInfo;
    }
}
